package com.zhangsr.zus.remoting.netty;

import com.zhangsr.zus.common.URL;
import com.zhangsr.zus.remoting.api.ChannelHandler;
import com.zhangsr.zus.remoting.api.Client;
import com.zhangsr.zus.remoting.api.Server;
import com.zhangsr.zus.remoting.api.Transporter;
import com.zhangsr.zus.remoting.api.exception.RemotingException;

/**
 * @Author: zhangsr
 */
public class NettyTransporter implements Transporter {

    public Server bind(URL url, ChannelHandler listener) throws RemotingException {
        return new NettyServer(url, listener);
    }

    public Client connect(URL url, ChannelHandler listener) throws RemotingException {
        return new NettyClient(url, listener);
    }
}
